using System;
using Server;
using Server.Network;

namespace Server.Items
{
    public class CollectionStatuette : BaseStatuette
    {
        public CollectionStatuette(int itemID): base(itemID)
        {
            LootType = LootType.Blessed;
            Weight = 1.0;
        }

        public CollectionStatuette(Serial serial): base(serial)
        {
        }

        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (TurnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) && Utility.InRange(m.Location, this.Location, 2) && !Utility.InRange(oldLocation, this.Location, 2))
            {
                PublicOverheadMessage(MessageType.Regular, 0x3B2, Utility.RandomMinMax(1073207, 1073216));
                Effects.PlaySound(Location, Map, Utility.RandomMinMax(0x5A, 0xE9));
            }

            base.OnMovement(m, oldLocation);
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }

    public class VesperCollectionStatuette : BaseStatuette
    {
        public VesperCollectionStatuette(int itemID): base(itemID)
        {
            LootType = LootType.Blessed;
            Weight = 1.0;
        }

        public VesperCollectionStatuette(Serial serial): base(serial)
        {
        }

        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (TurnedOn && IsLockedDown && (!m.Hidden || m.AccessLevel == AccessLevel.Player) && Utility.InRange(m.Location, this.Location, 2) && !Utility.InRange(oldLocation, this.Location, 2))
            {
                int cliloc = Utility.RandomMinMax(1073266, 1073286);

                if (cliloc == 1073282)
                    cliloc -= 1;

                PublicOverheadMessage(MessageType.Regular, 0x3B2, cliloc);
                Effects.PlaySound(Location, Map, Utility.Random(0x17));
            }

            base.OnMovement(m, oldLocation);
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0); // version
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
        }
    }
}